package milktea.servlet.home;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import milktea.entity.CATEGORY;
import milktea.service.CATEGORYService;

/**
 * Servlet implementation class IndexSelect
 */
@WebServlet("/myselect")
public class MySelect extends HttpServlet {

    /**
     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
     */
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        ArrayList<CATEGORY> flist = CATEGORYService.selectCat("father");
        request.setAttribute("flist", flist);

        ArrayList<CATEGORY> clist = CATEGORYService.selectCat("child");
        request.setAttribute("clist", clist);


        request.getRequestDispatcher("my.jsp").forward(request, response);


    }


}
